package com.andy.nature.app

import android.app.Application
import android.os.Build
import android.os.StrictMode
import android.os.StrictMode.VmPolicy
import com.andy.base.AppHelper
import com.andy.base.utils.MVUtils
import com.andy.common.BuildConfig
import com.andy.logcat.LogUploadHook
import com.andy.logcat.LogUtils


/**
 * Author:Andy
 * Date:2023/3/21 14:47
 * Description:NatureApplication
 */
class NatureApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        AppHelper.initContext(this)
        MVUtils.initMMKV()
        LogUtils.setDebug(BuildConfig.DEBUG)
        LogUtils.addHook(LogUploadHook())
        initShare()
    }

    private fun initShare() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            val builder = VmPolicy.Builder()
            StrictMode.setVmPolicy(builder.build())
        }
    }
}